import {
  getData
} from './request';

import {
  formatStrToJSON,
  setLocalList
} from '../utils/tools';

//通过外界传入store来修改
export default async (store) => {

  // const consName = store.state.consName,
  //   field = store.state.field;

  //获取后端数据
  // const data = await getData(consName, field);
  const data = await getData({
    swiper: false,
    phone: true,
    field: false
  });

  const phoneData = formatStrToJSON(data).phone_data;

  setLocalList(phoneData);
}